from app_factory import db

# 定义用户模型 db.Model基类
class User(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(100), nullable=False)
    email = db.Column(db.String(120), unique=True, nullable=False)
    password_hash = db.Column(db.String(128), nullable=False)

    # def check_password(self, password):
    #     from app_factory import bcrypt
    #     return bcrypt.check_password_hash(self.password_hash, password)